package com.cyh.core.login.repository;

import com.cyh.core.framework.repository.base.DefaultRepository;
import com.cyh.core.login.entity.User;

import org.springframework.data.jpa.repository.Query;

import javax.annotation.Resource;
import java.util.Optional;

@Resource
public interface UsersRepository extends DefaultRepository<User, Integer>{

    public Optional<User> findById(Integer Id);

    @Query(value = "select * from user where username=?",nativeQuery = true)
    public Optional<User> findByUsername(String Username);

}
